<%-- 
    Document   : index
    Created on : Sep 8, 2013, 2:29:59 AM
    Author     : Administrator
--%>

<%@page import="Model.Pojo.Danhmucsanpham"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%Danhmucsanpham dmsp = (Danhmucsanpham) request.getAttribute("updateDanhMuc");%>
<head>
    <meta charset="utf-8" />
    <%if (dmsp != null)
        {
    %> 
    <title>Cập nhật danh mục sản phẩm</title>
    <% }
    else
    {
    %><title>Thêm danh mục sản phẩm</title>
    <%}%>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="Mosaddek" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-fileupload.css" rel="stylesheet" />
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <link href="css/style-responsive.css" rel="stylesheet" />
    <link href="css/style-default.css" rel="stylesheet" id="style_color" />
    <link href="assets/fullcalendar/fullcalendar/bootstrap-fullcalendar.css" rel="stylesheet" />
    <link href="assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen"/>
</head>
<body class="fixed-top">

    <jsp:include page="User Control/banner.jsp" flush="true"></jsp:include>
        <div id="container" class="row-fluid">
            <!--------------------------------menu--------------------------------------->
        <jsp:include page="User Control/menu.jsp" flush="true"></jsp:include>
            <!--------------------------------end menu--------------------------------------->

            <!--------------------------------nội dung--------------------------------------->

            <div id="main-content">
                <div class="container-fluid">
                <jsp:include page="User Control/title.jsp" flush="true"></jsp:include>
                    <div class="row-fluid">
                        <div class="span12">
                            <!-- BEGIN VALIDATION STATES-->
                            <div class="widget red">
                                <div class="widget-title"><%
                                    if (dmsp != null)
                                    {
                                %>
                                <h4><i class=" icon-key"></i>Cập nhật danh mục sản phẩm</h4>
                                <%                                }
                                else
                                {
                                %>
                                <h4><i class=" icon-key"></i>Thêm danh mục sản phẩm</h4>
                                <%                                    }%>
                                <span class="tools">
                                    <a href="javascript:;" class="icon-chevron-down"></a>
                                    <a href="javascript:;" class="icon-remove"></a>
                                </span>
                            </div>
                            <div class="widget-body form">
                                <!-- BEGIN FORM-->
                                <form class="cmxform form-horizontal" id="commentForm" method="post" action="update-danh-muc.htm">
                                    <%
                                        Object obj = request.getAttribute("QUAN_LY_DANH_MUC");
                                        if (obj != null)
                                        {
                                            if (dmsp != null)
                                            {
                                    %>
                                    <input type="hidden" name="hdfIDDM" value="<%=dmsp.getId()%>" />
                                    <input type="hidden" name="hdfSLSPDM" value="<%=dmsp.getSoluongsp()%>" />
                                    <div class="control-group ">
                                        <label for="cname" class="control-label">Tên danh mục (*)</label>
                                        <div class="controls">
                                            <input class="span6 " id="txtTenDanhMuc" name="txtTenDanhMuc" minlength="2" type="text" required value="<%=dmsp.getTendanhmuc()%>"/>
                                        </div>
                                    </div>
                                    <div class="control-group ">
                                        <label for="cemail" class="control-label">Ký hiệu (*)</label>
                                        <div class="controls">
                                            <input class="span6 " id="txtKyHieu" name="txtKyHieu" minlength="2" type="text" required value="<%=dmsp.getKyhieu()%>"/>
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <button class="btn btn-success" type="submit" name="btnCapNhat">Cập nhật</button>
                                        <button class="btn" type="button" onclick="javascript:history.go(-1);">Hủy</button>
                                    </div>
                                    <%
                                    }
                                    else
                                    {
                                    %>

                                </form>
                                <form class="cmxform form-horizontal" id="commentForm" method="post" action="them-danh-muc.htm">            
                                    <div class="control-group ">
                                        <label for="cname" class="control-label">Tên danh mục (*)</label>
                                        <div class="controls">
                                            <input class="span6 " id="txtTenDanhMuc" name="txtTenDanhMuc" minlength="2" type="text" required/>
                                        </div>
                                    </div>
                                    <div class="control-group ">
                                        <label for="cemail" class="control-label">Ký hiệu (*)</label>
                                        <div class="controls">
                                            <input class="span6 " id="txtKyHieu" name="txtKyHieu" minlength="2" type="text" required />
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <button class="btn btn-success" type="submit">Lưu</button>
                                        <!--                                            <button class="btn" type="button">Hủy</button>-->
                                    </div>
                                    <%                                        }
                                    %>  

                                </form>
                                <%
                                    String message = (String) request.getAttribute("Message");
                                    if (message != null)
                                    {
                                        out.println(
                                                "<p align='center'><font style='size: 40px' color='red'>" + message + "</font></p>");
                                    }
                                }
                                else
                                {
                                %>
                                <h1 style="color: red">The page you requested was not found.
                                </h1>
                                <%                                            }
                                %>
                                <!-- END FORM-->
                            </div>
                        </div>
                        <!-- END VALIDATION STATES-->
                    </div>
                </div>
            </div>
        </div>
        <!-------------------------------- ket thuc nội dung--------------------------------------->
    </div>
    <!--------------------------------footer--------------------------------------->
    <jsp:include page="User Control/footer.jsp" flush="true" />
    <!--------------------------------end footer--------------------------------------->
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script type="text/javascript" src="assets/jquery-slimscroll/jquery-ui-1.9.2.custom.min.js"></script>
    <script type="text/javascript" src="assets/jquery-slimscroll/jquery.slimscroll.min.js"></script>
    <script src="assets/fullcalendar/fullcalendar/fullcalendar.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
    <script src="js/jquery.sparkline.js" type="text/javascript"></script>
    <script src="assets/chart-master/Chart.js"></script>
    <script src="js/common-scripts.js"></script>
    <script src="js/easy-pie-chart.js"></script>
    <script src="js/sparkline-chart.js"></script>
    <script src="js/home-page-calender.js"></script>
    <script src="js/chartjs.js"></script>
</body>
</html>